﻿using System;
using MayhemWP7;
using Microsoft.Phone.Controls;
using WP7Modules.Events;
using MayhemCore;

namespace WP7Modules.Pages
{
    public partial class TimerConfig : PhoneApplicationPage
    {
        public TimerConfig()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            
            // Get the index of the connection in the connection list
            int connectionIndex = Int32.Parse(NavigationContext.QueryString["id"]);

            this.DataContext = (Timer)Mayhem.Instance.ConnectionList[connectionIndex].Event;

            /*Enable = c.Enabled;

            // If we started enabled, disable ourselves.
            if (Enable) {
                Connection.Disable();
            }*/
        }
    }
}